package com.mycompany.crm.service.impl;

import com.mycompany.crm.base.BaseService;
import com.mycompany.crm.dao.PermissionMapper;
import com.mycompany.crm.service.PermissionService;
import com.mycompany.crm.vo.Permission;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author jy
 * @version 1.0
 * @date 2022/2/27 10:42
 */
@Service
public class PermissionServiceImpl extends BaseService<Permission,Integer> implements PermissionService {

    @Resource
    private PermissionMapper permissionMapper;

    /**
     * 通过用户拥有的角色所对应的资源，得到用户拥有的资源列表(资源权限码)
     * @param userId
     * @return
     */
    @Override
    public List<String> queryUserRoleHasPermissionByUserId(Integer userId) {
        return permissionMapper.queryUserRoleHasPermissionByUserId(userId);

    }
}
